package com.java.thread.sample_02;

public class Key2Value {
	//在给定时间点上，一个线程只能处于一种状态。这些状态是虚拟机状态，它们并没有反映所有操作系统线程状态。
	public static String threadState(Thread.State state){
		String desc = "";
		switch(state){
		case NEW:
			desc = "NEW_至今尚未启动的线程!";
			break;
		case RUNNABLE:
			desc = "RUNNABLE_正在 Java虚拟机中执行的线程!";
			break;
		case BLOCKED:
			desc = "BLOCKED_受阻塞并等待某个监视器锁的线程!";
			break;
		case WAITING:
			desc = "WAITING_无限期地等待另一个线程来执行某一特定操作的线程!";
			break;
		case TIMED_WAITING:
			desc = "TIMED_WAITING_具有指定等待时间的某一线程!";
			break;
		case TERMINATED:
			desc = "TERMINATED_已终止的线程!";
			break;
		default:break;
		}
		return desc;
	}
}